import request from '@/utils/request'

// 获取范例文件夹内的文件
export function getFileListApi(path) {
  return request({
    url: '/file/fileList',
    method: 'get',
    params: {"path":path}
  })
}

// 范例上传文件
export function templateUploadApi(file,path) {
  return request({
    url: '/file/template/upload',
    method: 'post',
    // params: {"path":path},
    data:file
  })
}

// 模糊获取范例多层图片
export function getTemplateFileListApi(path) {
  return request({
    url: '/file/template/fileList',
    method: 'get',
    params: {"path":path}
  })
}

// 范例删除文件
export function getTemplateDeleteApi(path) {
  return request({
    url: '/file/template/delete',
    method: 'get',
    params: {"path":path}
  })
}

// 获取项目文件夹内的文件
export function getProjectFileListApi(path,projectId) {
  return request({
    url: '/file/project/fileList',
    method: 'get',
    params: {"path":path,"projectId":projectId}
  })
}

// 模糊获取项目多层图片
export function getProjectFileListsApi(path,projectId) {
  return request({
    url: '/file/project/fileLists',
    method: 'get',
    params: {"path":path,"projectId":projectId}
  })
}

// 项目删除文件
export function deleteProjectApi(path,projectId) {
  return request({
    url: '/file/project/delete',
    method: 'delete',
    params: {"path":path,"projectId":projectId}
  })
}

// 获取文件流(Base64编码)
export function downloadBase64Api(path) {
  return request({
    url: '/file/download/base64',
    method: 'get',
    params: {"path":path}
  })
}

// 获取多个文件流(Base64编码)
export function downloadsBase64Api(paths) {
  return request({
    url: '/file/downloads/base64',
    method: 'post',
    data: paths
  })
}

// 获取文件流(Base64编码)
export function downloadApi(path) {
  return request({
    url: '/file/download',
    method: 'get',
    params: {"path":path},
    responseType: 'blob'
  })
}



